package com.example;

import java.util.ArrayList;
import java.util.List;

/**
 * @desc:
 * @author: Shoko
 * @date: 2025/5/25
 */
// 传感器类（主题）
public class Sensor {
    private List<ResponseDevice> devices = new ArrayList<>();

    public void attach(ResponseDevice device) {
        devices.add(device);
    }

    public void notify(TempEvent event) {
        for (ResponseDevice device : devices) {
            device.response(event);
        }
    }
}
